#-*- coding: UTF-8 -*-
'''
Created on 2012-7-13
装饰器
@author: Administrator
'''
from time import ctime, sleep

def tsfunc(func): 
    def wrappedFunc():
        print '[%s] %s() called' % (ctime(), func.__name__)
        return func() 
    return wrappedFunc

@tsfunc
def foo():
    print 'foo'

@tsfunc
def funp():
    print 'funp'

foo()
funp()
sleep(4)

for i in range(2):
    sleep(1)
    foo()
